package work;

/**
 * @TODO
 * @Author xu
 * 2025/2/24
 */
public class Day3_5 {
    public static void main(String[] args) {
        int count = 0;
        System.out.println("水仙花数有：");
        for (int i = 100; i < 1000; i++) {
            int sum = 0;
            int num = i;
            while (num > 0) {
                int digit = num % 10;
                sum += digit * digit * digit;
                num /= 10;
            }
            if (sum == i) {
                System.out.println(i);
                count++;
            }
        }
        System.out.println("水仙花数的个数是：" + count);
    }

}
